﻿using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
namespace AnyOffice.general.system.code
{
    public partial class delete : ModulePage   
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = (Request.QueryString["code_flag"] != null) ? Request.QueryString["code_flag"].ToString() : "";
            int num = (Request.QueryString["code_id"] != null) ? Convert.ToInt32(Request.QueryString["code_id"].ToString()) : 0;
            string commandText = "DELETE FROM [dbo].[Sys_Code] WHERE [CodeId]=@CodeId";
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@CodeId", SqlDbType.Int) };
            commandParameters[0].Value = num;
            SqlHelper.ExecuteNonQuery(base.Conn, CommandType.Text, commandText, commandParameters);
            base.CloseConn();
            Response.Redirect("func.aspx?code_no=" + str);
        } 

    }
}
